package com.cneport.das.server.trans.handler;

import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author GavinZhang
 * @version 1.0
 * @desc： 转换器的容器，所有的转换器均再次注册
 * @company 东方物通科技有限（北京）公司
 * @date 2021/9/7 11:24
 */
@Component
public class TransformerFamily {
    private static final Map<String, BaseTransformer> tranformers = new ConcurrentHashMap<>(0);

    public static void register(String name, BaseTransformer trans) {
        tranformers.put(name, trans);
    }

    public static Map<String, BaseTransformer> getAllTransformer() {
        return tranformers;
    }
}
